﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VNPT.Data
{
    public partial class GTGT
    {
        public string Nhom
        {
            get
            {
                if (string.IsNullOrWhiteSpace(this.DichVu))
                {
                    return "--";
                }
                if (this.DichVu!="DV1089")
                {
                    if (this.DichVu.StartsWith("DV108"))
                    {
                        return "DV108x";
                    }
                    if (this.DichVu.StartsWith("DV801"))
                    {
                        return "DV801x";
                    }
                    if (this.DichVu.StartsWith("DV802"))
                    {
                        return "DV802x";
                    }

                    return DichVu;
                }
                else
                {
                    return this.DichVu;
                }
            }
        }

        public string TenTinh { get; set; }
        public string DichVu { get; set; }
        public string MaMang { get; set; }
        public string MaVung { get; set; }


        public double Phut { get; set; }
        public double Cuoc { get; set; }

        public double Phut_DLK { get; set; }
        public double Cuoc_DLK { get; set; }

        public string TrangThai { get; set; }

        public double TiLe_Phut
        {
            get
            {
                if (this.Phut == 0 && this.Phut_DLK == 0)
                {
                    return 0;
                }
                return this.Phut > this.Phut_DLK ?
                    ((this.Phut - this.Phut_DLK) / (this.Phut) * 100) :
                    ((this.Phut_DLK - this.Phut) / (this.Phut_DLK) * 100);
            }
        }
        public double TiLe_Cuoc
        {
            get
            {
                if (this.Cuoc == 0 && this.Cuoc_DLK == 0)
                {
                    return 0;
                }
                return this.Cuoc > this.Cuoc_DLK ?
                    (this.Cuoc - this.Cuoc_DLK) / (this.Cuoc) * 100 :
                    (this.Cuoc_DLK - this.Cuoc) / (this.Cuoc_DLK) * 100;
            }
        }
        public string Query { get; set; }

    }
}
